package com.ruoyi.community.controller.wxApi;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.community.domain.RotationDiagram;
import com.ruoyi.community.service.IRotationDiagramService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 轮播图Controller
 * 
 * @author wj
 * @date 2022-03-10
 */
@RestController
@RequestMapping("/wx/community/diagram")
@Api(tags = {"轮播图"})
public class WxRotationDiagramController extends BaseController
{
    @Autowired
    private IRotationDiagramService rotationDiagramService;

    /**
     * 查询轮播图列表
     */
    @ApiOperation(value = "查询轮播图列表")
    @GetMapping("/list")
    public TableDataInfo list(RotationDiagram rotationDiagram)
    {
        startPage();
        List<RotationDiagram> list = rotationDiagramService.selectRotationDiagramList(rotationDiagram);
        if (ObjectUtils.isEmpty(list)){
            return getNoDataTable(list);
        }
        return getDataTable(list);
    }



    /**
     * 获取轮播图详细信息
     */
    @ApiOperation(value = "获取轮播图详细信息")
    @GetMapping(value = "/getInfo")
    public AjaxResult getInfo(Long id)
    {
        return AjaxResult.success(rotationDiagramService.selectRotationDiagramById(id));
    }


}
